//输出
function writeSum(){
   x=4;
   y=3;
   document.forms["sumform"]["sum"].value=x+y;
//   alert(x+y);
}


var slideIndex=0;
showSlide();

function setSlide(index){
   slideIndex=index;
}

//show slide
function showSlide(){
    var slides=document.getElementsByClassName("slide");
    var dots=document.getElementsByClassName("dot");
//    if(index>slides.length){
//    slideIndex=0;
//    }
//    if(index<0){
//    slideIndex=slides.length-index;
//    }
//    slideIndex=index;


    //hide all slides
    for(var i=0;i<slides.length;i++){
      slides[i].style.display="none";
      dots[i].className=dots[i].className.replace(" active","");
//       document.write("-----xixixixi-"+i);
    }

    slides[slideIndex].style.display="block";
    dots[slideIndex].className+=" active";

    slideIndex++;
    if(slideIndex>=slides.length){slideIndex=0;}

    setTimeout(showSlide,2000);

}